<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<script type="text/javascript">
	//1970年1月1日8:00到现在的毫秒数
	let date = new Date()
	//获取时间戳
	console.log(date.getTime()) // 1744774552090
	//时间戳转换成正常时间
	let date2 = new Date(1744774552090)
	console.log(date2) //Wed Apr 16 2025 11:35:52 GMT+0800 (GMT+08:00)

	//时间戳转换为正常时间
	date2.setTime(1744774552090)
	console.log(date2) //Wed Apr 16 2025 11:35:52 GMT+0800 (GMT+08:00)
</script>
</body>
</html>